package com.hp.bon.sgw.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name = "TP_HCODE")
public class TPHcode {
	private int hcodeId;
	private int tspId;
	private int areaCode;
	private Date validTime;
	private Date elapseTime;

	@Id
	@Column(name = "HCODE_ID")
	public int getHcodeId() {
		return hcodeId;
	}

	public void setHcodeId(int hcodeId) {
		this.hcodeId = hcodeId;
	}

	@Column(name = "TSP_ID")
	public int getTspId() {
		return tspId;
	}

	public void setTspId(int tspId) {
		this.tspId = tspId;
	}

	@Column(name = "AREA_CODE")
	public int getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(int areaCode) {
		this.areaCode = areaCode;
	}

	@Column(name = "VALID_TIME", nullable = true)
	@Temporal(TemporalType.DATE)
	public Date getValidTime() {
		return validTime;
	}

	public void setValidTime(Date validTime) {
		this.validTime = validTime;
	}

	@Column(name = "ELAPSE_TIME", nullable = true)
	@Temporal(TemporalType.DATE)
	public Date getElapseTime() {
		return elapseTime;
	}

	public void setElapseTime(Date elapseTime) {
		this.elapseTime = elapseTime;
	}

	@Transient
	public String toString() {
		return this.hcodeId + "|" + this.areaCode + "|" + this.tspId;
	}

}
